<template>
    <h2>readonly和shallowReadonly</h2>
    <h3>state:{{state2}}</h3>

    <hr>
    <button @click="update">更新数据</button>
</template>

<script lang="ts">

import {
    reactive, shallowReadonly, shallowRef
} from "vue";





export default {
    name: "App",
    setup() {

        // 只处理第一层， 第二层就不能改
        let state = shallowReadonly({
            name: "鸣人",
            age: 20,
            car: {
                name: "奔驰",
                color: "red"
            }
        })

        // 只处理基本数据类型的响应式， 不进行对象的响应式处理
        let a=shallowRef("")


        function update() {

        }
        return {
            update
        }
    }
}
</script>

<style>

</style>